<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>

  // console.log(localStorage);
  // console.log(window.localStorage);
  // console.log(window.localStorage === localStorage);

  // 增或改
  // localStorage.setItem("name", "admin");
  // localStorage.setItem("abc", "world");
  // localStorage.setItem("password", "123456");

  // 删
  // localStorage.removeItem("name")
  // localStorage.removeItem("abc")
  // localStorage.removeItem("goods")
  // localStorage.clear();

  // 查
  // console.log( localStorage.getItem("name") )
  // console.log( localStorage.getItem("abc") )
  // console.log( localStorage.getItem("password") )
  // console.log( localStorage.getItem("username") )

  // console.log(localStorage.length);
  // console.log(localStorage);
  
  // ==============
  
  // console.log(localStorage.name)
  // console.log(localStorage.abc)
  // console.log(localStorage.password)

  // localStorage.age = 19;
  // localStorage.child = {};
  // localStorage.show = function(){};

  // delete localStorage.abc;
  // delete localStorage.show;
  // delete localStorage.name;
  
  // console.log(localStorage);


  // ========

  // local和session的区别：时间

  // localStorage.setItem("username","admin")
  // sessionStorage.setItem("username","admin")

  console.log(localStorage);
  console.log(sessionStorage);

</script>
</html>